import 'package:flutter/material.dart';
import 'package:ball_lion/utils/utils.dart';

class ZqEvent {
  static const huanShang = 110;
  static const huanXia = 111;
  static const huangPai = 3;
  static const hongPai = 2;
  static const liangHuang = 9;
  static const jinQiu = 1;
  static const dianQiu = 7;
  static const wuLong = 8;
  static const fanGuiDianQiu = 37;
  static const sheShiDianQiu = 13;
  static const theVar = 14;
  static const banChangJieShu = 53;
  static const zhuGong = 21;
  static const jieShu = 5;
}

class ZqMilestoneUtils {
  static const double iconsize = 16;
  static iconGoal({double size = 16}) =>
      getImage("match_icon_jinqiu.png", size);
  static iconKick({double size = 16}) =>
      getImage("match_icon_dianqiu.png", size);
  static iconOwn({double size = 16}) => getImage("match_icon_wulong.png", size);
  static iconLoose({double size = 16}) =>
      getImage("match_icon_shidian.png", size);
  static iconConer({double size = 16}) =>
      getImage("match_icon_jiaoqiu.png", size);
  static iconZg({double size = 16}) => getImage("match_icon_zg.png", size);
  static iconVAR({double size = 16}) => getImage("match_icon_var.png", size);
  static iconRed({double size = 16}) =>
      getImage("match_icon_hongpai.png", size);
  static iconYellow({double size = 16}) =>
      getImage("match_icon_huangpai.png", size);
  static iconYR({double size = 16}) =>
      getImage("match_icon_lianghuang.png", size);
  static iconDown({double size = 16}) =>
      getImage("match_icon_huanxia.png", size);
  static iconUp({double size = 16}) =>
      getImage("match_icon_huanshang.png", size);

  static Widget getImage(String img, double size) {
    return Image.asset(Utils.getImgPath(img), width: size, height: size);
  }

  static List<int> importantEventId = [
    1,
    2,
    3,
    37,
    7,
    8,
    9,
    11,
    13,
    14,
    21,
    53,
    5
  ];

  static Image getIconWithEventType(int eventType, {double size = 16}) {
    switch (eventType) {
      case ZqEvent.hongPai:
        return iconRed(size: size);
      case ZqEvent.huangPai:
        return iconYellow(size: size);
      case ZqEvent.liangHuang:
        return iconYR(size: size);
      case ZqEvent.jinQiu:
        return iconGoal(size: size);
      case ZqEvent.fanGuiDianQiu:
        return iconConer(size: size);
      case ZqEvent.dianQiu:
        return iconKick(size: size);
      case ZqEvent.wuLong:
        return iconOwn(size: size);
      case ZqEvent.huanShang:
        return iconUp(size: size);
      case ZqEvent.huanXia:
        return iconDown(size: size);
      case ZqEvent.theVar:
        return iconVAR(size: size);
      case ZqEvent.sheShiDianQiu:
        return iconLoose(size: size);
      case ZqEvent.zhuGong:
        return iconZg(size: size);
      default:
        return iconGoal(size: size);
    }
  }

  static List icon = [
    iconGoal(),
    iconKick(),
    iconOwn(),
    iconConer(),
    iconVAR(),
    iconRed(),
    iconYellow(),
    iconYR(),
    iconDown(),
    iconUp()
  ];
  static List title = [
    '进球',
    '点球',
    '乌龙',
    '角球',
    "VAR",
    '红牌',
    '黄牌',
    '两黄',
    '下场',
    '上场'
  ];
}

class ZqLineupUtils {
  static List title = ['进球', '点球', '乌龙', '角球', '黄牌', '红牌', '两黄', '下场', '上场'];
  static List icon = [
    'match_icon_jinqiu.png',
    'match_icon_dianqiu.png',
    'match_icon_wulong.png',
    'match_icon_jiaoqiu.png',
    'match_icon_huangpai.png',
    'match_icon_hongpai.png',
    'match_icon_lianghuang.png',
    'match_icon_huanxia.png',
    'match_icon_huanshang.png',
  ];
  static List lineupIcon = [
    'match_lineup_jinqiu.png',
    'match_lineup_dianqiu.png',
    'match_lineup_wulong.png',
    'match_lineup_jiaoqiu.png',
    'match_lineup_huangpai.png',
    'match_lineup_hongpai.png',
    'match_lineup_lianghuang.png',
    'match_lineup_huanxia.png',
    'match_lineup_huanshang.png'
  ];
}
